let name = 'Sue'
let employee = {
    [name]:'worker'
}

console.log(employee.Sue);

// 相当于

let emp = {}
emp[name] = 'worker'
console.log(emp.Sue)

function emp(name) {
    return {
        name
    }
}